package com.indusfo.spc.mapper;

import com.indusfo.spc.pojo.Rule;
import org.apache.ibatis.annotations.Param;


import java.util.List;

public interface RuleMapper{

    /**
     * 编码查重
     * @param ruleId
     * @param ruleCode
     * @return
     */
    public Rule getByRuleCode(@Param("ruleId") Integer ruleId, @Param("ruleCode") String ruleCode);


    /**
     * 根据id查詢
     * @param ruleId
     * @return
     */
    public List<Rule> getRule(@Param("ruleId") Integer ruleId);

    /**
     * 查询全部集合
     * @param rule
     * @return
     */
    public List<Rule> listRule(Rule rule);

    /**
     * 分页总数
     * @param rule
     * @return
     */
    int countRule(Rule rule);

    /**
     * 删除
     *
     */
    int delRule(@Param("ids")Integer[] ids, @Param("dataState")Integer dataState);

    /**
     * 名称查重
     * @param ruleId
     * @param ruleName
     * @return
     */
    Rule getByRuleName(@Param("ruleId") Integer ruleId, @Param("ruleName") String ruleName);

    int insertSelective(Rule rule);

    int updateByPrimaryKeySelective(Rule rule);
}
